<?php
require_once ('vendor/autoload.php');
$giteeOAuth = new Yurun\OAuthLogin\Gitee\OAuth2();
$giteeOAuth->appid = "04b582befde7047c599cefabdf0701d99a6588f55dde8fec9b10c19fd5d249bf";
$giteeOAuth->appSecret = "a2797ca9c695c7008f99dcac3d16d7bb9d8de6fe65ac5ea345b1e28e1b7af36e";

$code = $_GET['code'];
//var_dump($giteeOAuth);
//$code = '7175d498298e7aebb13d61fc0ad5a4503407360a21fb2b06fdcab41746e2673c';

//$giteeOAuth->getAuthUrl("zmh.njphper.cn/userinfo.php");
try {

    $accessToken = $giteeOAuth->getAccessToken(1,$code,1);
    var_dump($accessToken);
}catch (Throwable $e){
    print_r($e);
}

